
#include <stdlib.h>

#ifndef __PROXYTEST_H__
#define __PROXYTEST_H__

typedef enum __time_sequence_type_t
{
	tst_begin=0,
	tst_dns=1,
	tst_connect=2,
	tst_request=3,
	tst_response=4,
	tst_end
} time_sequence_type_t;


typedef struct __proxy_available_info_t
{
	int http:1;
	int https:1;
	int sock5:1;
	int sock4:1;
	int sock4s:1;
} proxy_available_info_t;

typedef struct __proxy_request_info_t
{
	char host[256];
	char port[16];
} proxy_request_info_t;

typedef struct __proxy_result_info_t
{
	proxy_available_info_t status;
	struct timeval tv[tst_end];
} proxy_result_info_t;

typedef struct __proxy_info_t
{
	proxy_request_info_t request;
	proxy_result_info_t result;
} proxy_info_t;




inline int time_taken(const proxy_result_info_t *result, time_sequence_type_t sequence);




int http_proxy_test(proxy_info_t *proxy_info);
int https_proxy_test(proxy_info_t *proxy_info);
#endif//__PROXYTEST_H__
